<div class="row-fluid">
    <div class="span12">
        <div style="clear:both; height:20px"></div>
        <ul class="breadcrumb">
            <li>
                <a href="<?php echo $this->Html->url(array("controller" => "home", "action" => "index")); ?>">Home</a>
                <span class="divider">/</span>
            </li>
            <li class="active">
                <a href="<?php echo $this->Html->url(array("controller" => "home", "action" => "master")); ?>">マスター</a>
                <span class="divider">/</span>
            </li>
            <li class="active">お客様データベース 

            </li>
            
        </ul>

        <div class="row-fluid">
            <div class="span12">
                <!-- BEGIN SAMPLE FORMPORTLET-->
                <div class="widget green">
                    <div class="widget-title">
                        <h4><i class="icon-reorder"></i> お客様の詳細情報 </h4>
                        <span class="tools">
                            <a href="javascript:;" class="icon-chevron-down"></a>
                            <a href="javascript:;" class="icon-remove"></a>
                        </span>
                    </div>
                    <div class="widget-body">
                        
                        <!-- BEGIN FORM-->
                        <?php
                        echo $this->Form->create('Customers', array(
                            'inputDefaults' => array(
                                'div' => 'control-group',
                                'label' => array(
                                    'class' => 'control-label'
                                ),
                                'wrapInput' => 'controls'
                            ),
                            'class' => 'well form-horizontal',
                            'style' => 'position: relative;'
                        ));
                        ?>
                        <?php if(isset($buidings)):?>
                        <div style="position: absolute;right: 11px;top: 10px;width: 300px;">
                            <h4>Building of customer</h4>
                            <u>
                                <?php foreach($buidings as $building):?>
                                    <li><?php echo $building?></li>
                                <?php endforeach;?>
                            </u>
                        </div>
                        <?php endif;?>
                        <?php
                        echo $this->Form->input('CustId', array(
                            'label' => 'お客様ID <span class="required">*</span>',
                            'placeholder' => 'お客様のID',
                            'type' => 'text',
                            'class' => 'span6',
                            'required' => false,
                            'maxlength' => '20',
                        ));

                        echo $this->Form->input('CustName', array(
                            'label' => 'お客様名 <span class="required">*</span>',
                            'placeholder' => 'お客様の名前',
                            'class' => 'span6',
                            'type' => 'text',
                            'required' => false,
                            'maxlength' => '100',
                        ));
                        echo $this->Form->input('CustFurigana', array(
                            'label' => 'ふりがな',
                            'placeholder' => 'お客様のふりがな名',
                            'class' => 'span6',
                            'type' => 'text',
                            'required' => false,
                            'maxlength' => '100',
                        ));
                        echo $this->Form->input('ChargePerson', array(
                            'label' => '担当者',
                            'placeholder' => '担当者',
                            'class' => 'span6',
                            'type' => 'text',
                            'required' => false,
                            'maxlength' => '100',
                        ));
                        echo $this->Form->input('CustAddress', array(
                            'label' => '住所 <span class="required">*</span>',
                            'placeholder' => '住所',
                            'class' => 'span6',
                            'required' => false,
                            'maxlength' => '190',
                        ));
                        echo $this->Form->input('CustPhone', array(
                            'label' => '電話番号',
                            'placeholder' => '電話番号',
                            'class' => 'span6',
                            'required' => false,
                            'maxlength' => '19',
                        ));
                        ?>
                        <input type="text" name="data[Customers][Email]" id="email_fake" class="hidden" autocomplete="off" style="display: none;">
                        <?php
                        echo $this->Form->input('Email', array(
                            'label' => 'メールアドレス <span class="required">*</span>',
                            'placeholder' => 'メールアドレス',
                            'class' => 'span6',
                            'required' => false,
                            'class' => 'span6',
                            'maxlength' => '50',
                            'autocomplete' => 'off'
                        ));
                        if(empty($this->params["pass"]["0"])){
                            echo $this->Form->input('Pass', array(
                                'label' => 'パスワード <span class="required">*</span>',
                                'placeholder' => 'パスワード',
                                'class' => 'span6',
                                'type' => 'password',
                                'required' => false,
                                'maxlength' => '40',
                            ));
                        }else{
                             echo $this->Form->input('Pass', array(
                                'label' => 'パスワード <span class="required">*</span>',
                                'placeholder' => 'パスワード',
                                'class' => 'span6',
                                'type' => 'password',
                                'required' => false,
                                'maxlength' => '40',
                                 'afterInput' =>'<br/><span class="help-block text-danger" style="margin-top:10px;color:red">※パスワードを変更するの場合、入力してください。</span>'
                            ));
                        }
                        echo $this->Form->input('Note', array(
                            'label' => '備考',
                            'placeholder' => '備考',
                            'class' => 'span6',
                            'maxlength' => '300',
                        ));

//                            echo $this->Form->submit('Save', array(
//                                'div' => false,
//                                'class' => 'btn btn-primary'
//                        ));
                        ?>
                        <div class="form-actions">
                            <button type="submit" class="btn btn-success">保存</button>
                            <button onclick="location.href = '<?php echo $this->Html->url(array("controller" => "customer", "action" => "index")); ?>'" type="button" class="btn">戻る</button>
                        </div>
                        <?php echo $this->Form->end(); ?>
                    </div>
                </div>
                <!-- END SAMPLE FORM PORTLET-->
            </div>
        </div>




    </div>
</div>
